/**
 * 
 */
package org.vectrics.cv;

import java.io.Serializable;

import org.vectrics.user.Person;

/**
 * Representa un Skill asociado a una persona, indica el nivel que tiene la persona en el skill.
 * @author maguero
 */
public class PersonSkill implements Serializable, Comparable<ListableSkill>, ListableSkill {

	private static final long serialVersionUID = -4068751991527366312L;

	/** id. */
	private Long id;
	
	/** Person. */
	private Person person;
	
	/** Skill. */
	private Skill skill;
	
	/** Level. */
	private Level level;


	/**
	 * Compara el objeto PersonSkill contra otro objeto PersonSkill.
	 */
	public int compareTo(ListableSkill o) {
		return this.getName().compareTo(o.getName());
	}

	@Override
	public PersonSkill getPersonSkill() {
		return this;
	}

	@Override
	public String getName() {
		return this.getSkill().getName();
	}
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Person getPerson() {
		return person;
	}

	public void setPerson(Person person) {
		this.person = person;
	}

	public Skill getSkill() {
		return skill;
	}

	public void setSkill(Skill skill) {
		this.skill = skill;
	}

	public Level getLevel() {
		return level;
	}

	public void setLevel(Level level) {
		this.level = level;
	}
}
